﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Model.WeekPlan
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/rzcss.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Fckeditor/fckeditor.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <title>鄞州区财政局::电子绩效台帐系统</title>

    <script type="text/javascript">

        $(document).ready(function () {
            var oFCKeditor = new FCKeditor('FContent');
            oFCKeditor.BasePath = rootPath + "/fckeditor/";
            oFCKeditor.ToolbarSet = "Basic_Blank";
            oFCKeditor.ReplaceTextarea();

            var hdjsAlert = $("#hidMessage").val();
            var hdjsAlert2 = $("#hidIsClose").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
                if (hdjsAlert2 == "Y") {
                    window.returnValue = 'SUCCESS';
                    window.location.href = rootPath + "/Admin/WeekPlan/AddWeek?gowk=" + $('#hidgowk').val() + "&week=" + $('#hidweek').val();
                }
            }
        });

        function isUpdate(s, e) {
            var oFCKeditor = FCKeditorAPI.GetInstance("FContent");
            if (s.GetChecked() == true) {
                oFCKeditor.EditorDocument.body.contentEditable = true;
                $("#FContent_div").css("display", "block");
                $("#FContent_Readonly_div").css("display", "none");
            } else {
                oFCKeditor.EditorDocument.body.contentEditable = false;
                $("#FContent_div").css("display", "none");
                $("#FContent_Readonly_div").css("display", "block");
            }

           
        }
        /*FCK只读*/
        function FCKeditor_OnComplete(editor) {
           
            var clientcheckbox = ASPxClientCheckBox.Cast("up");
            if (clientcheckbox.GetChecked() == true) {
                editor.EditorDocument.body.contentEditable = true;
                $("#FContent_div").css("display", "block");
                $("#FContent_Readonly_div").css("display", "none");
            } else {
                editor.EditorDocument.body.contentEditable = false;
                $("#FContent_div").css("display", "none");
                $("#FContent_Readonly_div").css("display", "block");
            }
            editor.ToolbarSet.Collapse(); 
            if ($("#hisisvisible").val() == "false") {
                clientcheckbox.SetEnabled(false);
                ASPxClientButton.Cast("btnOK").SetEnabled(false);
            }                     
        }

        function ok() {
            form1.submit();
        }

    </script>

</head>
<body>
    <table width="1000" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
            <td>
                <table width="980" cellpadding="0" cellspacing="0" style="background:url(@Url.Content("~/Content/images/rztop.jpg")) no-repeat; margin-top:10px;">
                    <tr>
                        <td width="514" height="142" rowspan="2" valign="middle">
                            <span class="h1">这里是<span class="h2">@ViewData["user_name"].ToString()</span>的工作日志 </span>
                            <br />
                            <br />
                            <span class="wi">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我的工作计划录入</span><span class="h1"><br />
                            </span>
                            <br />
                        </td>
                        <td height="30" colspan="2" align="right" class="wi">
                            <a href="@Url.Action("WeekPlanList", "WeekPlan", new { gowk = 1 })">返回</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right" class="h3">
                            <span class="h4">@ViewData["year"].ToString()</span>年 第<span class="h4"> @ViewData["week"].ToString()</span> 周
                            @DateTime.Parse(@ViewData["wk"].ToString()).ToString("MM.dd")
                            -
                            @DateTime.Parse(@ViewData["wk1"].ToString()).ToString("MM.dd")&nbsp;&nbsp;&nbsp;&nbsp;
                            <br />
                            <span class="h5"><a href="@Url.Action("AddWeek", "WeekPlan", new { gowk = ViewData["prev"], empNo = ViewData["empNo"] })">上周</a> <a href="@Url.Action("AddWeek", "WeekPlan", new { gowk = 0, empNo = ViewData["empNo"] })">本周</a> <a href="@Url.Action("AddWeek", "WeekPlan", new { gowk = ViewData["next"], empNo = ViewData["empNo"] })">下周</a>&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <br />
                        </td>
                    </tr>
                </table>
                <table width="980" cellpadding="0" cellspacing="0" style="margin-top: 10px;">
                    <tr>
                        <td width="233" valign="top">
                            <table width="233" cellpadding="0" cellspacing="0" class="lefttable">
                                <tr>
                                    <td height="30" class="wi">
                                        &nbsp;&nbsp;&nbsp;&nbsp; <a href="@Url.Action("AddWeek", "WeekPlan", new { gowk = 1 })">计划录入</a> </td>
                                </tr>
                            </table>
                            <table width="233" cellpadding="0" cellspacing="0" class="lefttable">
                                <tr>
                                    <td height="30" class="wi">
                                        &nbsp;&nbsp;&nbsp;&nbsp; <a href="@Url.Action("AddDa", "Daily", new { gowk = 0 })">工作登记</a> </td>
                                </tr>
                            </table>
                        </td>
                        <td valign="top" width="734">
                            @using (Html.BeginForm("SaveWeekPlan", "WeekPlan", FormMethod.Post, new { id = "form1" }))
                            {
                                <table width="100%" cellpadding="0" cellspacing="0" class="tablerz">
                                    <tr>
                                        <td width="100">
                                            日期/星期</td>
                                        <td>
                                            @DateTime.Parse(@ViewData["wk"].ToString()).ToString("MM.dd")
                                            -
                                            @DateTime.Parse(@ViewData["wk1"].ToString()).ToString("MM.dd")
                                            工作计划及任务</td>
                                    </tr>
                                    <tr>
                                        <td width="70" >
                                            @Html.DevExpress().CheckBox(
                        settings =>
                        {
                            settings.Name = "up";
                            settings.Checked = (bool)ViewData["up"];
                            settings.ControlStyle.CssClass = "button";
                            settings.Properties.ClientSideEvents.CheckedChanged = "function(s, e){ isUpdate(s, e)}";
                        }
                    ).GetHtml()
                                            更新 </td>
                                        <td>
                                            <div id="FContent_div" style="display:none">
                                                @Html.TextArea("FContent", Model.FContent.Replace("\r\n", "<br />"), new { @cols = "70", @rows = "15" })
                                            </div>
                                            <div id="FContent_Readonly_div" style="display:none">
                                                <table border="0" align="left" cellpadding="0" cellspacing="0" style="background-color: White;">
                                                    <tr>
                                                        <td>
                                                            <div style="width: 550px; height: 200px; line-height: 15px; overflow-y: auto;">
                                                                @Html.Raw(@Model.FContent.Replace("\r\n", "<br />"))
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                            <div align="right" valign="bottom">
                                                @ViewData["lastUpdate"].ToString()
                                                <font color="red">@ViewData["last"].ToString()</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            </div>
                                        </td>
                                    </tr>
                                </table>

                                @Html.DevExpress().Button(settings =>
                {
                    settings.Name = "btnOK";
                    settings.Text = "确定更新";
                    settings.ControlStyle.CssClass = "button";
                    settings.Images.Image.Url = Url.Content("~/Content/ControlImages/ok.png");
                    settings.ClientSideEvents.Click = "function(){ok()}";
                }).GetHtml()

                                @Html.Hidden("hidprev", ViewData["prev"])
                                @Html.Hidden("hidnext", ViewData["next"])
                                @Html.Hidden("hidweek", ViewData["week"])
                                @Html.Hidden("hidyear", ViewData["year"])
                                @Html.Hidden("hidwk", ViewData["wk"])
                                @Html.Hidden("hidwk1", ViewData["wk1"])
                                @Html.Hidden("hiduser_name", ViewData["user_name"])
                                @Html.Hidden("hidup", ViewData["up"])
                                @Html.Hidden("hidlastUpdate", ViewData["lastUpdate"])
                                @Html.Hidden("hidlast", ViewData["last"])
                                @Html.Hidden("hisisvisible", ViewData["isvisible"])

                                @Html.Hidden("hidgowk", ViewData["gowk"])
                                @Html.Hidden("hidMessage", ViewData["message"])
                                @Html.Hidden("hidIsClose", ViewData["IsClose"])

                                @Html.Hidden("hidtype", ViewData["type"])
                                @Html.Hidden("hidid", ViewData["id"])
                            }
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
